/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package MainClass;

import Goodspackage.*;
/**
 * 存取商品
 * 设置临时Goods[]存放加入购物车的商品
 * @author 威
 */
public class GetGoods {
    
    private static boolean[] chooseGoods = new boolean[5];
    private static Goods[] goods = new Goods[5];
   static {
   goods = (Goods[])ReadGoods.readObjectFromFile();
   }
//   static
//      {
//			goods[0] = new Book("Java学习笔记", 68.00,100,"林信良");
//			goods[1] = new Book("白夜行",30.50,180,"东野圭吾");
//			goods[2] = new Phone("红米Note4X",1098.00,68881,"灰色","32G");
//			goods[3] = new Phone("华为 nova标配",1899.00,934,"香槟金","32G");
//			goods[4] = new Phone("Mate 9",3899.00,16418,"月光银","64G");
//			WriteGoods.writeObjectToFile(goods);
//		
//    } 

    public static Goods[] getGoods() {
        return goods;
    }

    public static boolean[] getChooseGoods() {
        return chooseGoods;
    }

    public static void setChooseGoods(int i) {
        
        chooseGoods[i] = true;
    }
    
    public static void main(String[] args) {
       //System.out.println(goods[4]);
    }
    
}
